<template>
  <div class="eventDetail">
    <el-dialog
      title="活动内容"
      :visible.sync="isVisible"
      @close="closeDialog"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      :modal-append-to-body="false"
      width="45%"
      center
    >
      <div class="item">
        <h3>活动名称：</h3>
        <span>{{formdata.name}}</span>
      </div>
      <div class="item">
        <h3>活动时间：</h3>
        <span>{{formdata.start_time}}-<span v-if="formdata.end_time==0">永久</span><span v-else>{{formdata.end_time}}</span></span>
      </div>
      <div class="item" v-if="formdata.type!=5">
        <h3>申请时间：</h3>
        <span v-if="formdata.apply_time_type==1">永久</span>
        <span v-else-if="formdata.apply_time_type==2">最晚活动结束后15天内</span>
        <span v-else>最晚活动结束后30天内</span>
      </div>
      <div class="item" v-if="formdata.type==4">
        <h3>申请方式：</h3>
        <span v-if="formdata.rebate_given_type==1">自动发放</span>
        <span v-else-if="formdata.rebate_given_type==2">手动申请</span>

      </div>
      <div class="item" v-if="formdata.type==4">
        <h3>返利货币：</h3>
        <span>{{formdata.rebate_currency}}</span>
      </div>
      <div class="item" v-if="formdata.type<=3">
        <h3>申请规则：</h3>
        <span v-if="formdata.type==1&&formdata.apply_rule==1">每天所有档位仅能选择一档申请一次</span>
        <span v-else-if="formdata.type==2&&formdata.apply_rule==1">活动期间所有档位仅能选择一档申请一次</span>
        <span v-else-if="formdata.type==1&&formdata.apply_rule==2">每天每档只可申请一次（满足高档位可同时申请低档位）</span>
        <span v-else-if="formdata.type==2&&formdata.apply_rule==2">活动期间每档只可申请一次（满足高档位可同时申请低档位）</span>
        <span v-else-if="formdata.type==3&&formdata.apply_times!=0">每天每档可申请{{formdata.apply_times}}次</span>
        <span v-if="formdata.type==3&&formdata.apply_times==0">每天每档可申请不限次数</span>
      </div>
      <div class="item" v-if="formdata.type<=3">
        <h3>发放时间：</h3>
        <span v-if="formdata.given_time_type==1">申请后次日0点发放</span>
        <span v-else-if="formdata.given_time_type==2">申请后24小时发放</span>
        <span v-else-if="formdata.given_time_type==3">申请后48小时发放</span>
        <span v-else-if="formdata.given_time_type==4">活动结束后24小时发放</span>
        <span v-else>活动结束后48小时发放</span>
      </div>
      <div class="item" v-if="formdata.type<=3">
        <h3>活动说明：</h3>
        <span>{{formdata.desc}}</span>
      </div>
      <div class="item" v-if="formdata.type==4">
        <h3>返利说明：</h3>
        <span>{{formdata.desc}}</span>
      </div>
      <div class="item" v-if="formdata.type>=4">
        <h3>活动内容：</h3>
        <span v-html="formdata.content"></span>
      </div>
      <div class="item" v-if="formdata.type<=3">
        <h3>活动内容：</h3>
        <div class="item-cont">
          <div v-for="(item,index) in formdata.activity_stage_str" :key="index">
            <h4>
              <i v-if="formdata.type==1">单日累充{{item.amount}}元，可申请奖励：</i>
              <i v-if="formdata.type==2">活动期间累充{{item.amount}}元，可申请奖励：</i>
              <i v-if="formdata.type==3">单笔充值{{item.amount}}元，可申请奖励：</i>
              <i class="choose" v-if="item.prize_content.length>=2">任选{{item.prize_num}}项</i>
              <p v-for="(item1,index1) in item.prize_content" :key="index1"><i v-if="item.prize_content.length>=2">{{index1+1}}、</i>{{item1}}</p>
            </h4>
          </div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: "eventDetail",
  inject: ["reload"],
  data() {
    return {
      isVisible: this.isShow,
      formdata: this.dialogRow,
    };
  },
  props: {
    isShow: Boolean,
    dialogRow: Object,
  },
  methods: {
    closeDialog() {
      this.$emit("closeDialog");
    },
  },
};
</script>
<style lang="scss">
.eventDetail {
  .el-dialog {
    min-height: 50%;
  }
  .item {
    display: flex;
    line-height: 32px;
    h3 {
      font-size: 14px;
      width: 85px;
    }
    i {
      font-size: 14px;
      font-weight: 600;
    }
    .item-cont {
      max-width: 550px;
      span {
        margin-left: 10px;
        font-size: 13px;
      }
    }
    span {
      max-width: 550px;
    }
    .choose {
      color: #409eff;
      font-weight: normal;
      font-size: 13px;
    }
  }
}
</style>